import { createApp } from 'vue'
import './style.css'
import ElementPlus from 'element-plus'
import 'element-plus/dist/index.css'
import zhCn from 'element-plus/es/locale/lang/zh-cn';//解决elementpLus一些组件是英文的问题
import * as Icons from '@element-plus/icons-vue'
import * as echarts from 'echarts'



import App from './App.vue'
import router from "./router/index" // 引入router
import store  from './store'

const app = createApp(App)
app.use(ElementPlus,{
    locale:zhCn
}).use(router).use(store).mount('#app')

app.config.globalProperties.$echarts = echarts
Object.keys(Icons).forEach((key) => {
    // app.component(key, Icons[key])  可以用这中方式 只是要在tsconfig.json 中加入
    // "suppressImplicitAnyIndexErrors": true,     // 解决字符串下标报错
    app.component(key, Icons[key as keyof typeof Icons])  
})
